package com.doit.day01;

import java.sql.SQLException;
import java.util.Iterator;

//每一个实现了Iterable 这个接口的类，必然有一个iterator这个方法
public class MyIterable implements Iterable<UserInfo>{
    @Override
    public Iterator<UserInfo> iterator() {
        MysqlIterator mysqlIterator = null;
        try {
            mysqlIterator = new MysqlIterator();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return mysqlIterator;
    }
}
